package com.cqyc.shop.services;

import java.util.List;

import com.cqyc.shop.comm.Pager;
import com.cqyc.shop.dao.ShopDao;
import com.cqyc.shop.domain.Shop;

public class ShopServices {
	
	ShopDao shopDao = new ShopDao();
	/**
	 * 商品修改以及保存
	 * @param shop
	 */
	public void save(Shop shop) {
		if(shop.getId()!=null) {
			shopDao.update(shop);
		}else {
			shopDao.save(shop);
		}
	}

	public List<Shop> findPager(Shop shop, Pager pager) {
		
		return shopDao.findPager(shop,pager);
	}

	/**
	 * 根据前台传过来的ID，查询出商品的信息
	 * @param id
	 * @return
	 */
	public Shop findId(Integer idd) {
		Shop shop = shopDao.findId(idd);
		return shop;
	}

}
